import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

const store = new Vuex.Store({
  state: {
    requestUrl: "https://www.baidu.com",
    theme: {
      backgroundColor: "black"
    }
  },
  mutations: {
    changeTheme(state, bgColor) {
      state.theme.backgroundColor = bgColor;
      document.body.style.background = bgColor;
    }
  }
});

export default store;
